package com.epoch.zuul.login;

import bean.response.ResponseBean;
import com.epoch.zuul.auth.role.Consumer;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 用户登录、注册
 * @author Seven
 * @date 2021/11/21
 */
@Service
public interface LoginService {

    /**
     * 用户登录
     * @param currentConsumer
     * @param request
     * @return
     */
    ResponseBean login(Consumer currentConsumer, String validateCode, HttpServletRequest request);

    /**
     * 用户注册
     * @param regConsumer
     * @param request
     * @param registerFor
     * @param validateCode
     * @return
     */
    ResponseBean register(Consumer regConsumer, HttpServletRequest request, String registerFor, String validateCode);

    /**
     * 获取 图片验证码
     * @param request
     * @param response
     * @throws IOException
     */
    void loginValidateCodeB(HttpServletRequest request, HttpServletResponse response) throws IOException;

    /**
     * 管理员登录
     * @param consumer
     * @param request
     * @return
     */
    ResponseBean managerLogin(Consumer consumer,HttpServletRequest request);

}
